import React, { Component } from 'react'
// 刚开始得时候没有这个弹窗，父组件给他传的布尔值变成true以后就可以出现了
// 数据过多怎么处理 就是上拉加载下拉刷新  或者分页
import { connect } from "react-redux"
import {debounce} from "lodash"
import * as action from "../action/index.js"
import { bindActionCreators } from "redux"
class Dirlog2 extends Component {
    cancle(){
        this.props.isShowFn(false)
    }
    sure(){
        this.props.deladdress(this.props.delind)
        this.props.isShowFn(false)
    }
  render() {
    return (
      <div>
          { 
            this.props.isShow ? 
              <div className='dirlog2'>
              <h5>您确定要删除吗？</h5>
              <p><button onClick={debounce(this.sure.bind(this),2000)}>确定</button> <button onClick={this.cancle.bind(this)}>取消</button></p>
            </div>:""
          }
      </div>
      
    )
  }
}
let mapStateToprops = (state) => {
    return {
        ...state.ShopReduer
    }
}
let mapDisPatchToProps = (dispatch) => bindActionCreators(action, dispatch)
export default connect(mapStateToprops, mapDisPatchToProps)(Dirlog2)
